<?php

/**
 * This is the model class for table "company_hotel".
 *
 * The followings are the available columns in table 'company_hotel':
 * @property integer $id ID
 * @property integer $company_id 企业ID
 * @property integer $uid 所属人
 * @property string $name 酒店名
 * @property string $image 图片
 * @property integer $province 省
 * @property integer $city 市
 * @property integer $district 区
 * @property string $star 酒店星级
 * @property string $address 详细地址
 * @property string $desc 酒店介绍
 */
class CompanyHotel extends ActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return CompanyHotel the static model class
	 */
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	public function getMdcClass() {
		return 'application.models.metadata.CompanyHotelMetadata';
	}
	
	public function __toString() {
		$enum = Yii::app()->enum;
		$name = '【'.$enum->lookup("district", $this->province) . " ".
		$enum->lookup("district", $this->city) . " ".
		$enum->lookup("district", $this->district).'】'.$this->name;
		return $name;
	}
}